package com.ls.lsbase.base;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.ls.lsbase.utils.AppManager;

/**
 * BaseActivity
 * Created by Administrator on 2017/5/17.
 */

public abstract class BaseActivity extends AppCompatActivity {
    Context context;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        context = BaseActivity.this;
        super.onCreate(savedInstanceState);
        AppManager.getAppManager().addActivity(this);
        setContentView(getContentLayout());
        init();
    }
    abstract int getContentLayout();

    abstract void init();

    @Override
    protected void onDestroy() {
        super.onDestroy();
        AppManager.getAppManager().finishActivity(this);
    }
}
